package BehaviorModel.mediatorModel;

public class CurtainsColleague extends Colleague{

    public CurtainsColleague(Mediator mediator,
                             String name) {
        super(mediator,
              name);
        mediator.registerMediator(name,
                                 this);
    }

    /**
     * 功能描述: 打开窗帘
     */
    public void openCurtains(){
        System.out.println(" 打开窗帘 ");
        sendMessage(1);
    }

    /**
     * 功能描述: 关闭窗帘
     */
    public void closeCurtains(){
        System.out.println(" 关闭窗帘 ");
        sendMessage(0);
    }

    @Override
    public void sendMessage(int stateChange) {
        this.getMediator().getMessage(stateChange,this.name);
    }
}
